$(document).ready(function(e) {
  var all_img = '';

  for(var i = 1; i <= 8; i++){
    $('.ace-file-input' + i + ' .remove').click(function(){
      $('#input-file-image' + i).ace_file_input('reset_input');
    });

    all_img += ((i > 1) ? ', ' : '') + '#input-file-image' + i;
  }
  
  $(all_img).ace_file_input({
    no_file:'No File ...',
    btn_choose:'Choose',
    btn_change:'Change',
    droppable:false,
    onchange:null,
    thumbnail:false
    //whitelist:'gif|png|jpg|jpeg'
  });
  
});

$('.date-picker').datepicker({autoclose:true}).next().on(ace.click_event, function(){
  $(this).prev().focus();
});
